// component/song-item-v1/index.js
import {playerStore} from '../../store/index'

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    item:{
      type:Object,
      value:{}
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
  handleItemClick(){
    const id = this.properties.item.id
    // 跳转播放歌曲详情页
    wx.navigateTo({
      url: '/packagePlayer/pages/music-player/index?id=' + id,
    })
    // wx.navigateTo({  
    //   url: '/packagePlayer/pages/music-player/index?id=' + id
    // })
    // 调用player-store里请求数据 播放歌曲
    playerStore.dispatch('getSongPlayerStore',{id})
  }
  }
})